package com.lys.emsystem.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lys.emsystem.mapper.ClassroomMapper;
import com.lys.emsystem.entity.Classroom;
import com.lys.emsystem.service.ClassroomService;
import com.lys.emsystem.vo.ClassroomVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClassroomServiceImpl implements ClassroomService {

    @Autowired
    private ClassroomMapper classroomMapper;

    @Override
    public IPage<Classroom> search(Page<Classroom> page, ClassroomVo classroomVo) {
        return classroomMapper.search(page, classroomVo);
    }

    @Override
    public int delList(int[] ids) {
        return classroomMapper.delList(ids);
    }

    @Override
    public int add(Classroom classroom) {
        return classroomMapper.insert(classroom);
    }

    @Override
    public int update(Classroom classroom) {
        return classroomMapper.updateById(classroom);
    }

    @Override
    public int delete(Long id) {
        return classroomMapper.deleteById(id);
    }

}
